package com.cn.order;



import com.cn.dto.VisitorDTO;
import com.cn.order.service.VisitorServiceImpl;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.test.context.junit4.SpringRunner;

import java.io.IOException;
import java.util.List;

@RunWith(SpringRunner.class)
@SpringBootTest
public class Visitor {
    @Autowired
    private VisitorServiceImpl visitorService;
//    @Autowired
//    private VisitorServiceImpl visitorService;
    @Test
    public void test() throws IOException {
        List<VisitorDTO> visitor = visitorService.findByVisitorId(1);
        System.out.println(visitor);
    }
    @Test
    public void test5() throws IOException {
        List<VisitorDTO> visitor = visitorService.findByOrderNumber("1");
        System.out.println(visitor);
    }

    @Test
    public void test1() throws IOException {
        VisitorDTO visitorDTO= new VisitorDTO();
        List<VisitorDTO> all = visitorService.findAll(visitorDTO);
        System.out.println(all);
    }

    @Test
    public void test2() throws IOException {
        VisitorDTO visitorDTO = new VisitorDTO(1,"身份证","龙某某","1","成人","12345678901","1",1);
        Object visitor1 = visitorService.add(visitorDTO);
        System.out.println(visitor1);
    }

//    @Test
//    public void test3() throws IOException {
//       Integer delete = visitorMapper.delete(2);
//        System.out.println(delete);
//    }
//
//    @Test
//    public void test4() throws IOException {
//        VisitorDTO visitorDTO = new VisitorDTO(1,"身份证","龙某某",1,"成人","10987654321",1,1);
//        Object visitor2 =visitorMapper.update(visitorDTO);
//        System.out.println(visitor2);
//    }
}

